package com.lianbang.pharmacy.module.main

import android.os.Bundle
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import cn.ubest.mvvmcore.base.BaseFragment
import cn.ubest.mvvmcore.interfaces.IEmptyView
import cn.ubest.mvvmcore.utils.DialogUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.listener.OnItemLongClickListener
import com.lianbang.pharmacy.R
import com.lianbang.pharmacy.adapter.ShopCarListAdapter
import com.lianbang.pharmacy.databinding.FragmentShopCarBinding
import com.lianbang.pharmacy.util.EmptyViewUtils
import com.lianbang.pharmacy.vm.MainVM
import kotlinx.android.synthetic.main.fragment_shop_car.*

/**
 * Created by maoqi on 2020/12/13.
 */
class ShopCarFragment : BaseFragment<MainVM, FragmentShopCarBinding>(), IEmptyView {

    companion object {
        fun newInstance(): ShopCarFragment {
            return ShopCarFragment()
        }
    }

    override fun initLayout(): Int {
        return R.layout.fragment_shop_car
    }

    override fun initData(arguments: Bundle?) {

    }

    override fun initView(view: View) {
        tv_toolbar_title.text = "采购车"
        view.findViewById<RecyclerView>(R.id.rv_list).apply {
            layoutManager = LinearLayoutManager(activity)
            adapter = ShopCarListAdapter().run {
                setEmptyView(getEmptyView())
                replaceData(mutableListOf("", "", ""))
                this
            }
        }
    }

    override fun loadData() {

    }

    override fun getEmptyView(): View {
        return EmptyViewUtils.getEmptyView(context, R.drawable.empty_shop_car, "采购车空空如也～")
//        return View.inflate(context, R.layout.empty_shop_car_list, null)
    }

}